home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWString / Sources / FWCharac.cpp < prev    next >
Encoding:
Text File  |  1995-11-08  |  1.2 KB  |  44 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWCharac.cpp
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWFound.hpp"
  11.  
  12. #ifndef FWCHARAC_H
  13. #include "FWCharac.h"
  14. #endif
  15.  
  16. #if FW_LIB_EXPORT_PRAGMAS
  17. #pragma lib_export on
  18. #endif
  19.  
  20. #pragma segment Strings
  21.  
  22. //----------------------------------------------------------------------------------------
  23. //    FW_StringLength
  24. //----------------------------------------------------------------------------------------
  25.  
  26. FW_CharacterCount FW_FUNC_ATTR FW_StringLength(const FW_Char * string)
  27. {
  28.     register const FW_Char * s = string;
  29.     const FW_Char nul = 0;
  30.     while (*s++ != nul)
  31.     {}
  32.     return (s - string - 1);
  33. }
  34.  
  35. // MetroWerks won't let me inline this. [AMB]
  36. //----------------------------------------------------------------------------------------
  37. //    FW_CharsToBytes
  38. //----------------------------------------------------------------------------------------
  39.  
  40. FW_ByteCount FW_CharsToBytes(FW_CharacterCount length)
  41. {
  42.     return length*sizeof(FW_Char);
  43. }
  44.